<?php
/**
 * licenses : MIT
 * creatTime: 2020/5/15
 * author : weblinuxgame
 * filename: HeaderEnum.php
 */

namespace App\Core\Enums;

/**
 * Interface HeaderEnum
 * @package App\Core\Enums
 */
interface HeaderEnum
{
    const DeviceUUid = 'X-UUID';
    const AppTraceCode = 'X-Code';
    const AppVersion = 'X-AppVer';
    const AuthToken = 'Authentication';
    const WebSocketAuthToken = 'X-AccessToken';
    const PrevRouterId = 'X-PrevRouterId';
    const ParamsSign = 'X-Sign';
    const DeviceType = 'X-DeviceType';
    const DeviceUa = 'X-UserAgent';
    const EncryptType = 'X-Encrypt';
    const AppId = 'X-AppId';
    const AppSecret = 'X-AppSecret';
    const WeChatAppId = 'X-Wx-AppId';
    const WeChatAppType = 'X-Wx-AppType';
    const WeChatAppVersion = 'X-Wx-Ver';

    const HeaderDescMap = [
        self::DeviceUUid => '设备uuid',
        self::AppTraceCode => '注册追踪码,kv,xx:xx',
        self::AppVersion => 'app version',
        self::AuthToken => 'api访问令牌token',
        self::WebSocketAuthToken => ' ws 令牌 token',
        self::PrevRouterId => '保持应用上次访问页面id,响应时头部原样返回',
        self::ParamsSign => '参数md5签名',
        self::DeviceType => '设备类型(0:浏览器,1:安卓,2:苹果,3:其他)',
        self::DeviceUa => '设备http客户端user-agent',
        self::EncryptType => '加密方式:(默认:00,[可选],00:使用头部参数校验,01:映射码头部校验,02:证书加密,03:内部算法加密,10:头部加密,20:参数加密,30:头部+参数都加密)',
        self::AppId => '平台其他应用AppId',
        self::AppSecret => '平台其他应用密钥',
        self::WeChatAppId => '微信应用appid',
        self::WeChatAppType => '微信应用类型(0:公众号,1:小程序,2:小游戏,3:企业号)',
        self::WeChatAppVersion => '微信应用版本号',
    ];

    // 密文头
    const EncryptMap = [
        'a' => self::AppVersion,
        'c' => self::AppTraceCode,
        'd' => self::DeviceType,
        'e' => self::EncryptType,
        'f' => self::PrevRouterId,
        'g' => self::DeviceUUid,
        'h' => self::DeviceUa,
        'i' => self::ParamsSign,
        'j' => self::AuthToken,
        'jw' => self::WebSocketAuthToken,
        'k' => self::AppId,
        'ks' => self::AppSecret,
        'm' => self::WeChatAppId,
        'mv' => self::WeChatAppVersion,
        'mt' => self::WeChatAppType,
    ];


}
